package br.jus.tjpe.listener;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

public class MySessionListener implements HttpSessionListener {
	
	private static int sessionCount = 0;

	public void sessionCreated(HttpSessionEvent se) {
		sessionCount++;
		se.getSession().getServletContext().log("Sessao criada!");
	}

	public void sessionDestroyed(HttpSessionEvent se) {
		if (sessionCount > 0)
			sessionCount--;
		se.getSession().getServletContext().log("Sessao destruida!");
	}
}